the format output type character in the date command has the following meanings:A%%a of the current locale (for example: Day, representing Sunday)%a the full name of the current locale (e.g., Sunday)%b the month name of the current locale (e.g.: one,
The format output type character in the date command means such as the following:A%%a of the current locale (for example: Day, representing Sunday)%a the full name of the current locale (for example: Sunday)%b The month name of the current locale
Lately I've racked my brains to write a shell that adjusts time, and it turns out that someday#info dataIt was ecstatic to see the flexible use of the data-d parameter. Good things to keep, tidy up:* To print the date of the day before
Description of UseThe ATE command can be used to display and modify the system datetime, noting that it is not a time command.Common parametersFormat: DateDisplays the current date time.Format: Date mmddhhmmFormat: Date mmddhhmmyyyyFormat: Date
Date of the Linux command I used-Display, modify system date TimeThis article link: http://codingstandards.iteye.com/blog/1157513 (reproduced please specify the source)Description of UseThe ATE command can be used to display and modify the system
Common parametersFormat: DateDisplays the current date time.Format: Date mmddhhmm # In short, it's the day of the month.Format: Date mmddhhmmyyyyFormat: Date MMDDHHMM.SSFormat: Date MMDDHHMMYYYY.SSSet the current date time, only the root user can
Local Test Cases:
# there can be no spaces on either side of the equal sign, before the error has been out here
yesterday= ' date-d last-day +%y-%m-%d '
echo $yesterday
curday= ' Date +%y-%m-%d '
echo $curday
echo "Now time: ' Date ' +%y%m%d%T '"
Digital time Transfer Standard Time:Digital time such as: 20151009163000Standard Time: 2015-10-19-16:30:00A= ' head-1/home/xxx/xxx/bin/.status |awk-f= ' {print $ {} ' |sed-r ' s/([0-9]{4}) ([0-9]{2}) ([0-9]{2}) ([0-9]{2}) ([}) ([0-9]{2}] ) ([0-9]{2})
1. Command format:Date [parameter] ... [+ format]2. Command function:Date can be used to display or set the day and time of the system.3. Command parameters:Necessary parameters:%H hours (expressed in 00-23).%I Hours (expressed in 01-12).%K hours
Use the shell in Linux to get yesterday, tomorrow, or many days ago:In Linux, the man date-d parameter is relatively vague, the following examples further illustrate:#-D,--date=string display time described by STRING, not ' now '[Email protected]
In the Linux environment, whether it is programming or other maintenance, time is essential, but also often use the time of the operation, skilled use of the date command to express the time you want to express, certainly can give their work to
use the shell in Linux to get yesterday, tomorrow or many days before the date time -- A- , the: -:xxblogjava-Expert Area Original http://www.blogjava.net/xzclog/archive/2015/12/08/428555.htmlTheme Shell Original address:
In the Linux environment, whether it is programming or other maintenance, time is essential, but also often use the time of the operation, skilled use of the date command to express the time you want to express, certainly can give their work to
In the Linux environment, whether it is programming or other maintenance, time is essential, but also often use the time of the operation, skilled use of the date command to express the time you want to express, certainly can give their work to
Original URL: http://www.cnblogs.com/peida/archive/2012/12/13/2815687.htmlIn the Linux environment, whether it is programming or other maintenance, time is essential, but also often use the time of the operation, skilled use of the date command to
In the Linux environment, whether it is programming or other maintenance, time is essential, but also often use the operation of time, skilled use of the date command to express the time they want to express, can certainly give their work to bring
Shell obtains the system time and returns the date + % Y-% m-% d of the current day. output:, assign the value of myDate to my variable $ (date + % Y % m % d) assign the current DATE to the DATE variable date $ (DATE + % Y % m % d). sometimes we
First, how does Perl get
Copy Code code as follows:
#!/usr/bin/perl-w
Use POSIX QW (strftime);
My $day = strftime ("%y%m%d", LocalTime (time-24*3600)); #获取昨天的日期
Second, in Linux on the man date-d parameters of the
In the Linux environment, whether it is programming or other maintenance, time is essential, but also often use the time of the operation, skilled use of the date command to express the time you want to express, certainly can give their work to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.